<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script src="js/jquery-2.0.3.js"></script>
<!-- -->
<h1>Ajax查询</h1>

     <input type="button" id="btn" value="查询"><br/>
     <div id="user"></div>
     
<script>
  $(function(){
	  $("#btn").click(function(){
		  
		  $.ajax({
			  url: "users2",
			  type: "GET",
			  data: {
				  id: 1 //备用,目前数据时假的
			  },
			  dataType: "json",
			  success:function(data){
				  $("#user").html(data.id+","+data.username);
			  }
			  
		  });
		  
	  });
	  
  })
</script>     
</body>
</html>